﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Grpc.Core;
using GrpcLibrary;

namespace GrpcClient
{
    class Program
    {
        static void Main(string[] args)
        {
            Channel channel = new Channel("127.0.0.1:9007",ChannelCredentials.Insecure);


            var client = new GrpcService.GrpcServiceClient(channel);

            for (int i = 0; i < 10; i++)
            {
                var reply = client.SayHello(new HelloRequest { Name = "name_"+i.ToString(),Wtype=1});

                Console.WriteLine("来自" + reply.Message);
                Thread.Sleep(1000);
            }

            

            channel.ShutdownAsync().Wait();
            Console.WriteLine("任意键退出...");
            Console.ReadKey();


        }
    }
}
